package com.miyu.client1.utils.baseDao;

import com.blinkfox.fenix.jpa.FenixJpaRepositoryFactory;
import com.blinkfox.fenix.jpa.FenixJpaRepositoryFactoryBean;
import org.springframework.data.jpa.repository.support.JpaRepositoryFactory;
import org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.core.RepositoryMetadata;
import org.springframework.data.repository.core.support.RepositoryFactorySupport;

import javax.persistence.EntityManager;
import java.io.Serializable;


public class MiyuRepositoryFactoryBean <T extends Repository<S, ID>, S, ID>
        extends JpaRepositoryFactoryBean<T, S, ID> {

    /**
     * 用来创建一个新的 {@link MiyuRepositoryFactoryBean} 实例的构造方法.
     *
     * @param repositoryInterface must not be {@literal null}.
     */
    public MiyuRepositoryFactoryBean(Class<? extends T> repositoryInterface) {
        super(repositoryInterface);
    }

    /**
     * 返回 {@link FenixJpaRepositoryFactory}.
     *
     * @param entityManager EntityManager 实体管理器.
     * @return MiyuJpaRepositoryFactory 实例
     */
    @Override
    protected RepositoryFactorySupport createRepositoryFactory(EntityManager entityManager) {
        return new MiyuJpaRepositoryFactory(entityManager);
    }


}
